<template>
	<view>
		<!-- 该例子是有命名空间的 -->
		<view>{{text}}</view>
		<view>时间戳：{{timestamp}}</view>
		<view>当前时间:{{timeString}}</view>
		<button type="default" @click="updateTime">刷新当前时间 同步</button>
		<button type="default" @click="updateTimeToAction">刷新当前时间 异步</button>
	</view>
</template>

<script>
	// namespaced: true,
	import { mapState, mapGetters,mapMutations,mapActions } from 'vuex'
	export default {
		methods: {
			...mapActions({
				updateTimeToAction:'moduleB/updateTimeToAction'
			}),
			...mapMutations({
				updateTime:'moduleB/updateTime'
			})
		},
		computed: {
			...mapState({
				text: state => state.moduleA.text,
				timestamp: state => state.moduleB.timestamp
			}),
			...mapGetters({
				timeString:'moduleB/timeString'
			}),
			
		}
	}
</script>

<style lang="scss" scoped>

</style>
